home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Source / MiscInspectorKit / MiscInspectorWrapper.m < prev    next >
Text File  |  1995-04-12  |  2KB  |  110 lines

  1. /* MiscInspectorWrapper.m                 
  2.  *
  3.  * This is a class that allows a simple collection of single inspectors that
  4.  * work one the same type of data. To the manager they all appear as one
  5.  * mulitpurpose inspector.
  6.  *
  7.  * For more interface-info see the header file. In depth information
  8.  * can be found here in the source-code.
  9.  *
  10.  * Written by:         Thomas Engel
  11.  * Created:            08.02.1994 (Copyleft)
  12.  * Last modified:     24.02.1994
  13.  *
  14.  * Copyright (c) 1995 Thomas Engel
  15.  */
  16.  
  17. //#import "MiscInspectorWrapper.h"
  18. //#import "MiscInspector.h"
  19. #import <misckit/MiscSwapView.h>
  20. #import <misckit/misckit.h>
  21.  
  22. @implementation MiscInspectorWrapper
  23.  
  24. - (BOOL)doesHandleSelection
  25. {
  26.     // Because we are not able to load a default NIB will we'll return NO 
  27.     // by default here.
  28.     // Your subclass has to do some work here
  29.     
  30.     return NO;
  31. }
  32.  
  33. - setManager:anObject
  34. {
  35.     manager = anObject;
  36.     [manager addInspector:self];
  37.     return self;
  38. }
  39.  
  40. - addInspector:anInspector
  41. {
  42.     // We don't add the inspector to the real manager but only to our
  43.     // controller list. After we have done so we can inform the single 
  44.     // inspector(controller) who the real manager is. But then he will not
  45.     // register automatically! No now and not in the future.
  46.     
  47.     if( !controllers ) controllers = [List new];
  48.     
  49.     [controllers addObject:anInspector];
  50.     [anInspector setManager:manager registerSelf:NO];
  51.     return self;
  52. }
  53.  
  54. - addWrappedControllers
  55. {
  56.     // Let get the real swapView and add all our controllers
  57.     
  58.     id    swapView;
  59.     int    i;
  60.     
  61.     swapView = [manager swapView];
  62.     for( i=0; i<[controllers count]; i++ )
  63.         [swapView addController:[controllers objectAt:i]];
  64.  
  65.     return self;
  66. }
  67.  
  68. - window
  69. {
  70.     return [manager window];
  71. }
  72.  
  73. - okButton
  74. {
  75.     return [manager okButton];
  76. }
  77.  
  78. - revertButton
  79. {
  80.     return [manager revertButton];
  81. }
  82.  
  83. - selection
  84. {
  85.     return [manager selection];
  86. }
  87.  
  88. - (unsigned)selectionCount
  89. {
  90.     return [manager selectionCount];
  91. }
  92.  
  93. @end
  94.  
  95. /*
  96.  * History: 24.02.94 Added the selection etc methods.
  97.  *
  98.  *            08.02.94 First code entered.
  99.  *
  100.  *
  101.  * Bugs: - no read/write;
  102.  *
  103.  *         - addInspector might cause some problems if the controllers register
  104.  *           befoe the real manager has registered.
  105.  *           Not really a big deal because this can only happen when we use 
  106.  *           wrappers inside a NIB that also contains the inspectorManager.
  107.  *           This is useless because we have created wrappers to work a NIB
  108.  *           wrappers in some way and doesHandle load the NIB so the manager 
  109.  *           definitly will be valid...when you use this object as intended.
  110.  */